﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Member.DAL;
using Member.IDAL;
using Member.IBLL;
using Member.Model;

namespace Member.BLL
{
    public partial class PricesBLL:BaseBLL<Prices>,IPricesBLL
    {
        private IPricesDAL dal = new PricesDAL();
        public override void setDAl()
        {
            Dal = dal;
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public bool delete(Prices p)
        {
            var s = dal.GetModels(ps => ps.prices_id == p.prices_id).FirstOrDefault();
            dal.Delete(s);
            return dal.SaveChange();
        }
        /// <summary>
        /// 根据查询条件获取总数量
        /// </summary>
        /// <param name="WhereLambda">条件</param>
        /// <returns></returns>
        public int maxshow(System.Linq.Expressions.Expression<Func<Prices, bool>> WhereLambda)
        {
            int max = dal.GetModels(WhereLambda).Count();
            return max;
        }
    }
}
